package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import play.data.validation.MaxSize;
import play.data.validation.Required;
import play.db.jpa.Model;

@Entity(name="comment")
public class Comment extends Model{

	private static final long serialVersionUID = 1L;
	
	public String author;
	public String url;
	public Date addTime;
	@Lob
	@Required
    @MaxSize(10000)
	public String content;
	@ManyToOne
	public Post post;
	
	public Comment(Post post,String author,String url,String content) {
		this.post = post;
		this.author = author;
		this.url = url;
		this.content = content;
		this.addTime = new Date();
	}
}
